package com.yuwei.database.db

import android.content.Context
import androidx.room.Room
import com.yuwei.database.dao.UserInfoDao

object DBUtils {
    private lateinit var database: AppDataBase
    fun init(context : Context){
        database = Room.databaseBuilder(context,AppDataBase::class.java,"park.db").build()
    }
    fun getUserInfoDao() : UserInfoDao{
        if(database == null){
            throw RuntimeException("数据库未初始化")
        }
        return database.getUserInfoDao()
    }

}